home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Xm / LabelGP.h.z / LabelGP.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  11.1 KB  |  330 lines

  1. /*
  2.  * LabelGP.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* 
  26.  * @OSF_COPYRIGHT@
  27.  * (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
  28.  * ALL RIGHTS RESERVED
  29.  *  
  30. */ 
  31. /*
  32.  * HISTORY
  33.  * Motif Release 1.2.5
  34. */
  35. /*   $XConsortium: LabelGP.h /main/cde1_maint/2 1995/08/18 19:09:19 drk $ */
  36. /*
  37. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  38. /*
  39. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  40. #ifndef _XmLabelGP_h
  41. #define _XmLabelGP_h
  42.  
  43. #include <Xm/LabelG.h>
  44. #include <Xm/GadgetP.h>
  45. #include <Xm/ExtObjectP.h>
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. /*************************************************************/
  52. /* The Label Gadget Cache Object's class and instance records*/
  53. /*************************************************************/
  54.  
  55.  
  56. typedef struct _XmLabelGCacheObjClassPart
  57. {
  58.     int foo;
  59. } XmLabelGCacheObjClassPart;
  60.  
  61.  
  62. typedef struct _XmLabelGCacheObjClassRec     /* label cache class record */
  63. {
  64.     ObjectClassPart            object_class;
  65.     XmExtClassPart                     ext_class;
  66.     XmLabelGCacheObjClassPart         label_class_cache;
  67. } XmLabelGCacheObjClassRec;
  68.  
  69. externalref XmLabelGCacheObjClassRec xmLabelGCacheObjClassRec;
  70.  
  71.  
  72. /*  The Label Gadget Cache instance record  */
  73.  
  74. typedef struct _XmLabelGCacheObjPart
  75. {
  76.         unsigned char    label_type;
  77.         unsigned char    alignment;
  78.         unsigned char    string_direction;
  79.     
  80.     Dimension    margin_height;   /* margin around widget */
  81.     Dimension    margin_width;
  82.  
  83.     Dimension    margin_left;    /* additional margins on */
  84.     Dimension    margin_right;   /* each side of widget */
  85.     Dimension    margin_top;     /* text (or pixmap) is placed */
  86.     Dimension    margin_bottom;  /* inside the margins */
  87.  
  88.     Boolean recompute_size;
  89.  
  90.     Boolean        skipCallback; /* set by RowColumn when entryCallback
  91.                     is provided. */
  92.     unsigned char   menu_type;
  93. } XmLabelGCacheObjPart;
  94.  
  95. typedef struct _XmLabelGCacheObjRec
  96. {
  97.     ObjectPart               object;
  98.     XmExtPart                 ext;
  99.     XmLabelGCacheObjPart     label_cache;
  100. } XmLabelGCacheObjRec;
  101.  
  102. /*  The Label Widget Class and instance records  */
  103. /*************************************************/
  104.  
  105. typedef struct _XmLabelGadgetClassPart     /* label class record */
  106. {
  107.         XtWidgetProc        setOverrideCallback;
  108.     XmMenuProc        menuProcs;
  109.         XtPointer            extension; /* Pointer to extension record */
  110. } XmLabelGadgetClassPart;
  111.  
  112. typedef struct _XmLabelGadgetClassRec
  113. {
  114.     RectObjClassPart       rect_class;
  115.     XmGadgetClassPart      gadget_class;
  116.     XmLabelGadgetClassPart label_class;
  117. } XmLabelGadgetClassRec;
  118.  
  119. externalref XmLabelGadgetClassRec xmLabelGadgetClassRec;
  120.  
  121. typedef struct _XmLabelGadgetPart
  122. {
  123.     _XmString    _label;  /* String sent to this widget */
  124.         _XmString       _acc_text;
  125.         KeySym            mnemonic;
  126.     XmStringCharSet mnemonicCharset;
  127.         char         *accelerator;
  128.         XmFontList    font;
  129.  
  130.         Pixmap        pixmap; 
  131.         Pixmap        pixmap_insen; 
  132.  
  133.         /* PRIVATE members -- values computed by LabelWidgetClass methods */
  134.  
  135.         GC        normal_GC;   /* GC for text */    
  136.     GC        insensitive_GC;
  137.         XRectangle    TextRect;    /* The bounding box of the text, or clip
  138.                                         rectangle of the window; whichever is
  139.                                         smaller */
  140.         XRectangle    acc_TextRect; /* The bounding box of the text, or clip
  141.                                         rectangle of the window; whichever is
  142.                                         smaller */
  143.  
  144.     XmLabelGCacheObjPart *cache;
  145.  
  146. } XmLabelGadgetPart;
  147.  
  148.  
  149. typedef struct _XmLabelGadgetRec
  150. {
  151.    ObjectPart        object;
  152.    RectObjPart       rectangle;
  153.    XmGadgetPart      gadget;
  154.    XmLabelGadgetPart label;
  155. } XmLabelGadgetRec;
  156.  
  157. /* Inherited  Functions exported by label */
  158.  
  159. #define XmInheritSetOverrideCallback ((XtWidgetProc) _XtInherit)
  160. #define XmInheritResize  ((XtWidgetProc) _XtInherit)
  161.  
  162. /* Padding between label text and accelerator text */
  163.  
  164. #define LABELG_ACC_PAD        15
  165.  
  166. /* MACROS */
  167. /********
  168.  * Macros for cached instance fields
  169.  */
  170. #define LabG_LabelType(w)        (((XmLabelGadget)(w)) -> \
  171.                        label.cache-> label_type)
  172. #define LabG_Alignment(w)        (((XmLabelGadget)(w)) -> \
  173.                        label.cache-> alignment)
  174. #define LabG_StringDirection(w)        (((XmLabelGadget)(w)) -> \
  175.                        label.cache-> string_direction)
  176. #define LabG_MarginHeight(w)        (((XmLabelGadget)(w)) -> \
  177.                                            label.cache-> margin_height)
  178. #define LabG_MarginWidth(w)        (((XmLabelGadget)(w)) -> \
  179.                                            label.cache-> margin_width)
  180. #define LabG_MarginLeft(w)        (((XmLabelGadget)(w)) -> \
  181.                                            label.cache-> margin_left)
  182. #define LabG_MarginRight(w)        (((XmLabelGadget)(w)) -> \
  183.                                            label.cache-> margin_right)
  184. #define LabG_MarginTop(w)        (((XmLabelGadget)(w)) -> \
  185.                                            label.cache-> margin_top)
  186. #define LabG_MarginBottom(w)        (((XmLabelGadget)(w)) -> \
  187.                                            label.cache-> margin_bottom)
  188. #define LabG_RecomputeSize(w)        (((XmLabelGadget)(w)) -> \
  189.                                            label.cache-> recompute_size)
  190. #define LabG_SkipCallback(w)        (((XmLabelGadget)(w)) -> \
  191.                                            label.cache-> skipCallback)
  192. #define LabG_MenuType(w)        (((XmLabelGadget)(w)) -> \
  193.                                            label.cache-> menu_type)
  194. /********
  195.  * Macros for UNcached instance fields
  196.  */
  197. #define LabG__label(w)            (((XmLabelGadget)(w)) -> \
  198.                        label._label)
  199. #define LabG__acceleratorText(w)    (((XmLabelGadget)(w)) -> \
  200.                                            label._acc_text)
  201. #define LabG_Font(w)            (((XmLabelGadget)(w)) -> \
  202.                        label.font)
  203. #define LabG_Mnemonic(w)        (((XmLabelGadget)(w)) -> \
  204.                        label.mnemonic)
  205. #define LabG_MnemonicCharset(w)         (((XmLabelGadget)(w)) -> \
  206.                                            label.mnemonicCharset)
  207. #define LabG_Accelerator(w)        (((XmLabelGadget)(w)) -> \
  208.                                            label.accelerator)
  209. #define LabG_Pixmap(w)            (((XmLabelGadget)(w)) -> \
  210.                                            label.pixmap)
  211. #define LabG_PixmapInsensitive(w)    (((XmLabelGadget)(w)) -> \
  212.                                            label.pixmap_insen)
  213. #define LabG_NormalGC(w)        (((XmLabelGadget)(w)) -> \
  214.                                            label.normal_GC)
  215. #define LabG_InsensitiveGC(w)        (((XmLabelGadget)(w)) -> \
  216.                                            label.insensitive_GC)
  217. #define LabG_TextRect(w)        (((XmLabelGadget)(w)) -> \
  218.                                            label.TextRect)
  219. #define LabG_AccTextRect(w)        (((XmLabelGadget)(w)) -> \
  220.                                            label.acc_TextRect)
  221.  
  222.  
  223. /********
  224.  * Convenience Macros 
  225.  */
  226. #define LabG_TextRect_x(w)        (LabG_TextRect(w).x)
  227.                                            
  228. #define LabG_TextRect_y(w)        (LabG_TextRect(w).y)
  229.                                            
  230. #define LabG_TextRect_width(w)        (LabG_TextRect(w).width)
  231.                                            
  232. #define LabG_TextRect_height(w)        (LabG_TextRect(w).height)
  233.                                            
  234. #define LabG_IsText(w)            (LabG_LabelType(w) == XmSTRING)
  235.  
  236. #define LabG_IsPixmap(w)        (LabG_LabelType(w) == XmPIXMAP)
  237.  
  238. #define LabG_Cache(w)            (((XmLabelGadget)(w))-> \
  239.                        label.cache)
  240. #define LabG_Shadow(w)                   (((XmLabelGadget)(w))->gadget.shadow_thickness)
  241. #define LabG_Highlight(w)                (((XmLabelGadget)(w))->gadget.highlight_thickness)
  242. #define LabG_Baseline(w)                 (_XmStringBaseline ( \
  243.                                          ((XmLabelGadget)(w))->label.font,\
  244.                                          ((XmLabelGadget)(w))->label._label))
  245. #define LabG_ClassCachePart(w) \
  246.     (((XmLabelGadgetClass)xmLabelGadgetClass)->gadget_class.cache_part)
  247.  
  248.  
  249. /********    Private Function Declarations    ********/
  250. #ifdef _NO_PROTO
  251.  
  252. extern int _XmLabelCacheCompare() ;
  253. extern void _XmCalcLabelGDimensions() ;
  254. extern void _XmReCacheLabG() ;
  255. extern void _XmAssignLabG_MarginHeight() ;
  256. extern void _XmAssignLabG_MarginWidth() ;
  257. extern void _XmAssignLabG_MarginLeft() ;
  258. extern void _XmAssignLabG_MarginRight() ;
  259. extern void _XmAssignLabG_MarginTop() ;
  260. extern void _XmAssignLabG_MarginBottom() ;
  261. extern void _XmProcessDrag() ;
  262.  
  263. #else
  264.  
  265. extern int _XmLabelCacheCompare( 
  266.                         XtPointer A,
  267.                         XtPointer B) ;
  268. extern void _XmCalcLabelGDimensions( 
  269.                         Widget wid) ;
  270. extern void _XmReCacheLabG( 
  271.                         Widget wid) ;
  272. extern void _XmAssignLabG_MarginHeight( 
  273.                         XmLabelGadget lw,
  274. #if NeedWidePrototypes
  275.                         int value) ;
  276. #else
  277.                         Dimension value) ;
  278. #endif /* NeedWidePrototypes */
  279. extern void _XmAssignLabG_MarginWidth( 
  280.                         XmLabelGadget lw,
  281. #if NeedWidePrototypes
  282.                         int value) ;
  283. #else
  284.                         Dimension value) ;
  285. #endif /* NeedWidePrototypes */
  286. extern void _XmAssignLabG_MarginLeft( 
  287.                         XmLabelGadget lw,
  288. #if NeedWidePrototypes
  289.                         int value) ;
  290. #else
  291.                         Dimension value) ;
  292. #endif /* NeedWidePrototypes */
  293. extern void _XmAssignLabG_MarginRight( 
  294.                         XmLabelGadget lw,
  295. #if NeedWidePrototypes
  296.                         int value) ;
  297. #else
  298.                         Dimension value) ;
  299. #endif /* NeedWidePrototypes */
  300. extern void _XmAssignLabG_MarginTop( 
  301.                         XmLabelGadget lw,
  302. #if NeedWidePrototypes
  303.                         int value) ;
  304. #else
  305.                         Dimension value) ;
  306. #endif /* NeedWidePrototypes */
  307. extern void _XmAssignLabG_MarginBottom( 
  308.                         XmLabelGadget lw,
  309. #if NeedWidePrototypes
  310.                         int value) ;
  311. #else
  312.                         Dimension value) ;
  313. #endif /* NeedWidePrototypes */
  314. extern void _XmProcessDrag( 
  315.                         Widget w,
  316.                         XEvent *event,
  317.                         String *params,
  318.                         Cardinal *num_params) ;
  319.  
  320. #endif /* _NO_PROTO */
  321. /********    End Private Function Declarations    ********/
  322.  
  323.  
  324. #ifdef __cplusplus
  325. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  326. #endif
  327.  
  328. #endif /* _XmLabelGP_h */
  329. /* DON'T ADD ANYTHING AFTER THIS #endif */
  330.